<div class="worker-info work-info-detail main shadowbox equipmentInfoDetail">
  <div class="container-header">设备信息查看
    <!-- <div class="pa-btn go-back" ui-sref="equipmentInfo">
      <i class="fa fa-reply"></i>
      <span class="ml5">返回</span>
    </div> -->
  </div>
  <div class="info-items info-vendor">
    <div class="info-title">
      <span class="title-brief">基本信息</span>
      <div class="edit">
        <div class="info-pencil"
          ng-click="vm.baseInfoEventHandler.toggleEditable()">
          <div ng-hide="vm.editable">
            <i class="fa fa-pencil"></i>
            <span>编辑</span>
          </div>
          <div ng-show="vm.editable">
            <i class="fa fa-reply"></i>
            <span>取消</span>
          </div>
        </div>
      </div>
    </div>
    <form class="base-info pa-form-content"
      ng-class="{'editable':vm.editable}"
      name="equipInfo"  role="form" novalidate="" autocomplete="off">
      <div class="row-fl fl">
        <div class="row-item">
          <div class="pa-form-control pa-base-form-control">
            <label class="fl"><b>*</b>设备名称：</label>
            <div class="pa-input pa-input-edit fl">
              <input type="text" name="deviceName" required
                ng-model="vm.editableEquipmentInfo.deviceName" />
            </div>
            <div class="pa-input pa-input-unedit">{{vm.equipmentInfo.deviceName}}
            </div>
            <span class="mandatory"
              ng-show="(equipInfo.$submitted || equipInfo.deviceName.$dirty) && equipInfo.deviceName.$error.required">
              必填
            </span>
          </div>
          <div class="pa-form-control pa-base-form-control">
            <label class="fl">内部编号：</label>
            <div class="pa-input pa-input-edit fl">
              <input type="text"
                ng-model="vm.editableEquipmentInfo.innerNo" />
            </div>
            <div class="pa-input pa-input-unedit">{{vm.equipmentInfo.innerNo}}
            </div>
          </div>
          <div class="pa-form-control pa-base-form-control">
            <label class="fl">设备型号：</label>
            <div class="pa-input pa-input-edit fl">
              <input type="text" ng-model="vm.editableEquipmentInfo.deviceModel"/>
            </div>
            <div class="pa-input pa-input-unedit">{{vm.equipmentInfo.deviceModel}}
            </div>
          </div>
        </div>
        <div class="row-item">
          <div class="pa-form-control pa-base-form-control">
            <label class="fl">使用地点：</label>
            <div class="pa-input pa-input-edit fl">
              <input type="text" ng-model="vm.editableEquipmentInfo.usingSites" />
            </div>
            <div class="pa-input pa-input-unedit">{{vm.equipmentInfo.usingSites}}
            </div>
          </div>
          <div class="pa-form-control pa-base-form-control">
            <label class="fl">牌照：</label>
            <div class="pa-input pa-input-edit fl">
              <input type="text" ng-model="vm.editableEquipmentInfo.license"  />
            </div>
            <div class="pa-input pa-input-unedit">{{vm.equipmentInfo.license}}
            </div>
          </div>
          <div class="pa-form-control pa-base-form-control">
            <label class="fl"><b>*</b>设备等级：</label>
            <div class="pa-input pa-input-edit fl">
              <select name="deviceLevel" required
                ng-model="vm.editableEquipmentInfo.deviceLevel">
                <option value="1"
                  ng-selected="vm.equipmentInfo.deviceLevel == 1">
                  一般设备
                </option>
                <option value="2"
                  ng-selected="vm.equipmentInfo.deviceLevel == 2">
                  主要设备
                </option>
                <option value="3"
                  ng-selected="vm.equipmentInfo.deviceLevel == 3">
                  关键设备
                </option>
                <option value="4"
                  ng-selected="vm.equipmentInfo.deviceLevel == 4">
                  特种设备
                </option>
              </select>
            </div>
            <div class="pa-input pa-input-unedit">
              {{vm.equipmentInfo.deviceLevel_}}
            </div>
            <span class="mandatory"
              ng-show="(equipInfo.$submitted || equipInfo.deviceLevel.$dirty) && equipInfo.deviceLevel.$error.required">
              必填
            </span>
          </div>
        </div>
        <div class="row-item">
          <div class="pa-form-control pa-base-form-control">
            <label class="fl"><b>*</b>进场时间：</label>
            <div class="pa-input pa-input-edit fl">
              <input type="text" ng-datepicker name="approachTime" required
                ng-model="vm.editableEquipmentInfo.approachTime">
            </div>
            <div class="pa-input pa-input-unedit">{{vm.equipmentInfo.approachTime}}
            </div>
            <span class="mandatory"
              ng-show="(equipInfo.$submitted || equipInfo.approachTime.$dirty) && equipInfo.approachTime.$error.required">
              必填
            </span>
          </div>
          <div class="pa-form-control pa-base-form-control">
            <label class="fl">退场时间：</label>
            <div class="pa-input pa-input-edit fl">
              <input type="text" ng-datepicker
                ng-model="vm.editableEquipmentInfo.exitTime">
            </div>
            <div class="pa-input pa-input-unedit">
              {{vm.equipmentInfo.exitTime}}
            </div>
          </div>
          <div class="pa-form-control pa-base-form-control">
            <label class="fl">是否租赁：</label>
            <div class="pa-input pa-input-edit fl">
              <input type="radio" class="sex-checkbox" name="gender"
              value="1" ng-model="vm.editableEquipmentInfo.isRented" />是
              <input type="radio" class="sex-checkbox" name="gender"
              value="0" ng-model="vm.editableEquipmentInfo.isRented" />否
            </div>
            <div class="pa-input pa-input-unedit">
              {{vm.equipmentInfo.isRented == '1' ? '是' :
              vm.equipmentInfo.isRented == '0' ? '否' : ''}}
            </div>
          </div>
        </div>
        <div class="row-item">
          <div class="pa-form-control pa-base-form-control">
            <label class="fl" style="width: 140px;"><b>*</b>检测（验收）情况：</label>
            <div class="pa-input pa-input-edit fl">
              <input type="text" name="maintainSituation" required
                ng-model="vm.editableEquipmentInfo.maintainSituation"/>
            </div>
            <div class="pa-input pa-input-unedit">{{vm.equipmentInfo.maintainSituation}}
            </div>
            <span class="mandatory"
              ng-show="(equipInfo.$submitted || equipInfo.maintainSituation.$dirty) && equipInfo.maintainSituation.$error.required">
              必填
            </span>
          </div>
        </div>
        <div class="row-item">
          <div class="pa-form-control pa-base-form-control"
            style="width: auto;">
            <label class="fl">操作人员：</label>
             <!-- 下拉多选-->
            <div class="pa-input right-value pa-input-edit"
              style="width: 190px;height: auto;"
              id="take_part_workers">
              <button class="show_btn"
                ng-click="vm.isShowSelect=!vm.isShowSelect">
                请选择
              </button>
              <div class="show_content" ng-show="vm.isShowSelect">
                <div ng-repeat="teamGroup in vm.teamWithOrgList">
                  <label class="team-unit">{{teamGroup.orgUnitName}}</label>
                    <dl ng-repeat = "team in teamGroup.teamList">
                      <dd>
                        <input type="checkbox"
                          style="width: 16px;"
                          ng-model="team.checked"
                          ng-click="vm.checkAll(team,$event)"/>
                        <span class="team-construction"
                          ng-click="vm.showWorkers(team)">
                          {{team.teamName}}
                        </span>
                      </dd>
                      <dt ng-show="team.isShowWorker"
                        ng-repeat="worker in team.workerInfoBeanList">
                        <input type="checkbox"
                          style="width: 16px;"
                          ng-model="worker.checked"
                          ng-change="vm.isChange(team.teamId);" />
                        {{worker.workerName}}
                      </dt>
                    </dl>
                </div>
                <center ng-show="vm.teamWithOrgList.length == 0">暂无数据</center>
              </div>
            </div>
            <div class="pa-input pa-input-unedit"
              style="width: auto;">
              <span style="cursor: pointer;" ng-repeat="item in vm.workerList"
              ui-sref="workerInfoDetail({id: item.id})">{{item.name}}{{$index == vm.workerList.length - 1 ? '' : ','}}</span>
            </div>
          </div>
        </div>
      </div>
      <div class="row-fr">
        <!-- 编辑 -->
        <div style="margin: 0;" ng-show="vm.editable">
          <div class="img-box">
            <avatar-upload
              component-id="cp1"
              pick-btn-id="avatar_picker"
              upload-url="{{fileUploadUrl.device}}"
              image-file="vm.editableEquipmentInfo.fileBean">
            </avatar-upload>
          </div>
          <avatar-attachment-upload
            component-id="cp2"
            pick-btn-id="avatar_attachment_picker"
            upload-url="{{fileUploadUrl.device}}"
            file-list="vm.editableEquipmentInfo.accessoryFileBeans">
          </avatar-attachment-upload>
        </div>

        <!-- 展示头像和文件 -->
        <div style="margin: 0;" ng-show="!vm.editable">
          <div class="img-box">
            <div class="avatar-upload-outer">
              <img class="avatar-img"
                ng-src="{{vm.baseInfoEventHandler.getAvatarSrc()}}"/>
            </div>
          </div>
          <div class="avatar-attachment-upload-outer">
            <div class="file-list-outer">
              <div class="file-item"
                ng-repeat="item in vm.editableEquipmentInfo.accessoryFileBeans">
                <span class="upload-file-name">{{item.fileName}}</span>
                <div>
                  <a class="pa-btn"
                    ng-click="vm.preview(item, archiveDetail)">
                    预览
                  </a>
                  <a class="pa-btn file-del-btn" target="_blank"
                    ng-href="{{vm.getDownloadSrc(item)}}">
                      下载
                  </a>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </form>
    <div class="btn-outer" ng-show="vm.editable">
      <a class="pa-btn"
        authorization-btn="api/deviceinfo/updateDeviceInfo"
        ng-click="vm.baseInfoEventHandler.save(equipInfo)">
        <i class="fa fa-save" ></i>
        <span class="ml5">保存</span>
      </a>
      <a class="pa-btn reset-btn" ng-click="vm.baseInfoEventHandler.reset()">
        <i class="fa fa-repeat"></i>
        <span class="ml5">重置</span>
      </a>
    </div>
  </div>
  <!-- 验收记录 -->
  <div class="info-items">
    <div class="info-title">
      <span class="title-brief">验收记录</span>
      <div class="edit-add" ng-click="vm.toggleAcceptanceEditable()">
        <i class="fa fa-plus"></i>
        <span>{{vm.acceptanceEditable ? '取消' : '编辑'}}</span>
      </div>
    </div>
    <div class="equipInfo-content img-uploader-outer">
      <!-- 展示文件列表 -->
      <div ng-show="!vm.acceptanceEditable">
        <div class="file-list-outer">
          <div class="file-item" style="margin: 10px 0;width: 50%;background-color: #E7E7E7;"
            ng-repeat="item in vm.editableEquipmentInfo.fileBeans">
            <div style="margin: 0 10px;padding: 0 10px;background-color: #fff;">
              <span class="upload-file-name" style="width: 70%;">{{item.fileName}}</span>
              <a class="pa-btn"
                ng-click="vm.preview(item, archiveDetail)">
                预览
              </a>
              <a class="pa-btn file-del-btn" target="_blank"
                ng-href="{{vm.getDownloadSrc(item)}}">
                  下载
              </a>
            </div>
          </div>
        </div>
      </div>
      <!-- 编辑验收记录 -->
      <div ng-show="vm.acceptanceEditable">
        <common-attachment-upload
          component-id="cp2"
          file-type="file"
          pick-btn-id="acceptancePicker"
          upload-url="{{fileUploadUrl.device}}"
          file-list="vm.editableEquipmentInfo.fileBeans"
          is-uploading="isUploading"></common-attachment-upload>
        <div class="btn-outer" style="padding-bottom: 20px;">
          <a class="pa-btn" ng-click="vm.saveAcceptanceImage()">
            <i class="fa fa-save"></i>
            <span class="ml5">保存</span>
          </a>
          <a class="pa-btn reset-btn" ng-click="vm.toggleAcceptanceEditable()">
            <i class="fa fa-repeat"></i>
            <span class="ml5">取消</span>
          </a>
        </div>
      </div>
    </div>
  </div>
  <div class="info-items">
    <div class="info-title">
      <span class="title-brief">检测记录</span>
      <div class="edit-add"
        authorization-btn="api/devicecheckrecord/insertCheckRecord"
        ng-click="vm.addCheckRecord()">
        <i class="fa fa-plus"></i>
        <span>新增</span>
      </div>
    </div>
    <div class="equipInfo-content">
      <div class="equipInfo-item" ng-repeat="item in vm.checkRecordList">
        <div class="equipInfo-brief">
          <div class="brief-item">
            <label>检测时间：</label>
            <div class="brief-result">{{item.checkTime}}</div>
          </div>
          <div class="brief-item">
            <label>下次检测时间：</label>
            <div class="brief-result">{{item.nextChecktime}}</div>
          </div>
          <div class="brief-item">
            <label>检测结果：</label>
            <div class="brief-result">
              {{item.checkResult == 1 ? '合格' : item.checkResult == 2 ? '不合格' : '待定'}}
            </div>
          </div>
        </div>
        <div class="equipInfo-record-show img-uploader-outer">
          <div class="file-list-outer">
            <div class="file-item"
              ng-repeat="file in item.fileBeans"
              style="font-size: 14px;">
              <span class="upload-file-name">{{file.fileName}}</span>
              <a class="pa-btn"
                ng-click="vm.preview(file, archiveDetail)">
                预览
              </a>
              <a class="pa-btn file-del-btn" target="_blank"
                ng-href="{{vm.getDownloadSrc(file)}}">
                  下载
              </a>
            </div>
          </div>
        </div>
        <div class="equipInfo-delete"
          authorization-btn="api/devicecheckrecord/deleteCheckRecord"
          ng-click="vm.deleteCheckRecord(item.id)">
          <i class="fa fa-trash"></i>
        </div>
      </div>
    </div>
  </div>
  <!-- 维保记录 -->
  <div class="info-items">
    <div class="info-title"><span class="title-brief">维保记录</span>
      <div class="edit-add" ng-click="vm.addMainRecord()" ng-show="!vm.addRecord">
        <i class="fa fa-plus"></i>
        <span>新增</span>
      </div>
    </div>
    <form class="base-info pa-form-content">
      <div class="problems-list-outer">
        <table class="pa-table">
          <thead>
            <tr>
              <th>维保时间</th>
              <th>维保内容</th>
              <th>操作</th>
            </tr>
          </thead>
           <tbody>
            <tr ng-repeat = "item in vm.maintainRecordList">
              <td>
                <div class="pa-input-unedit">
                  {{item.maintainTime}}
                </div>
              </td>
              <td>
                <div class="pa-input-unedit">
                  {{item.maintainContent}}
                </div>
              </td>
              <td>
                <div>
                  <div class="edit-item"
                    ng-click="vm.seeMaintanceRecord(item, $index)">
                    <i class="fa fa-street-view"></i>
                    <span>查看</span>
                  </div>
                  <div class="edit-item"
                    ng-click="vm.editMaintanceRecord(item, $index)">
                    <i class="fa fa-pencil"></i>
                    <span>编辑</span>
                  </div>
                  <div class="edit-item"
                    authorization-btn="api/devicemaintainrecord/deleteMaintainRecord"
                    ng-click="vm.recordDetete(item)">
                    <i class="fa fa-trash"></i>
                    <span>删除</span>
                  </div>
                </div>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
    </form>
  </div>
</div>